//
//  LastestResCell.m
//  夺宝吧
//
//  Created by xiaocai on 15/7/7.
//  Copyright (c) 2015年 FangYuan. All rights reserved.
//

#import "LastestResCell.h"

@interface LastestResCell ()
{
    __weak IBOutlet UILabel *nameLab;
    __weak IBOutlet UIImageView *pdcImg;
    __weak IBOutlet UILabel *userLab;
    __weak IBOutlet UILabel *codeLab;
    __weak IBOutlet UILabel *countLab;
    __weak IBOutlet UILabel *timeLab;
}
@end
@implementation LastestResCell

- (void)awakeFromNib {
    [self addSubview:[WYPublic getFenGexian:0 :self.frame.size.height - 1 :WYMWITH :0.5]];}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)fillCellWhithModel:(LatestCellModel*)model 
{
    [pdcImg sd_setImageWithURL:[NSURL URLWithString:model.pdc_img_url] placeholderImage:[UIImage imageNamed:@"moren"]];
    nameLab.text = [NSString stringWithFormat:@"(第%@期)%@",model.pdc_qishu,model.pdc_title];
    if ([model.pdc_owner_name class] != [NSNull class] && (model.pdc_owner_name != nil)) {
        userLab.text = model.pdc_owner_name;
    }else{
        userLab.text =@"获取失败";
    }
    if (![model.pdc_owner_code isKindOfClass:[NSNull class]] && (model.pdc_owner_name != nil)){
        codeLab.text = model.pdc_owner_code;
    }else{
        codeLab.text = @"无法获取";
    }
    
    countLab.attributedText = [WYPublic getRedMiddleStrWithLeft:@"" Middle:[NSString stringWithFormat:@"%ld",(unsigned long)model.pdc_owner_totle] RightStr:@"次" Font:12];
    timeLab.text = model.pdc_end_time;
}

@end
